<?php
	
	echo "test";
	
	include("Connection.php");
	session_start();

	$query = "	UPDATE 	member
				SET 	CardNo='${_POST['card_number']}'
				WHERE 	Username='${_SESSION['username']}'	";
	$result = mysql_query($query);
	
	if(!$result){
		die("Can't execute".mysql_error());
	}
	
	$query2 = "	INSERT INTO credit_card (CardNo, Name, CCV, ExpiryDate, BillingAdd)
				VALUES (${_POST['card_number']}, ${_POST['name_on_card']}, ${_POST['ccv']},
						${_POST['expiry_date']}, ${_POST['billing_address']});				";
	$result2 = mysql_query($query2);
	
	if(!$result2){
		die("Can't execute".mysql_error());
	}
	
	mysql_close($link);
	header("Location: https://academic-php.cc.gatech.edu/groups/cs4400_Group_7/Homepage.php");
?>
